package ca.etsmtl.log430.lab3.presentation;

import java.util.Collection;
import java.util.Observable;

import ca.etsmtl.log430.lab3.gestion.ifaces.ICommonData;
import ca.etsmtl.log430.lab3.gestion.ifaces.ICourse;
import ca.etsmtl.log430.lab3.presentation.cmdline.Displays;

public class ListUnassignedCourses  extends Communication {

	
	
	/**
	 * @uml.property  name="systemInterface"
	 * @uml.associationEnd  multiplicity="(1 1)"
	 */
	ICommonData systemInterface;

	/**
	 * 
	 * @param systemInterface
	 * @param registrationNumber
	 * @param componentName
	 */
	public ListUnassignedCourses( ICommonData systemInterface,Integer registrationNumber,
			String componentName) {
		super(registrationNumber, componentName);
		this.systemInterface = systemInterface;
	}
	
	public void update(Observable thing, Object notificationNumber) {
		if (registrationNumber.compareTo((Integer) notificationNumber) == 0) {
			Displays display = new Displays();
			Collection<? extends ICourse> courses = systemInterface.getUnAssignedCourses();
			display.displayCourseList(courses);
	 }
	}

}
